package org.dioib.practice.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;


@Configuration
//@EnableSwagger2 // @EnableSwagger2WebMvc, 如果是Spring Boot 3.x 或者 Spring MVC 可能需要使用 @EnableSwagger2
//@EnableSwagger2WebMvc
//@ConditionalOnExpression("${swagger.enable:true}")
public class SwaggerConfig {
    //@Bean
//    public Docket api() {
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(buildApiInfo())
//                .select()
//                .paths(PathSelectors.any())
//                .apis(RequestHandlerSelectors.basePackage("org.dioib.practice.controller")) // 替换为你的控制器所在包名
//                .build();
//    }
//
//    private ApiInfo buildApiInfo() {
//        return new ApiInfoBuilder()
//                .title("My Application API")
//                .description("Documentation for My Application REST APIs")
//                .contact(new Contact("系统RESTful API文档", "http://localhost.com", "dioib@follow.re"))
//                .version("1.0")
//                .build();
//    }
}

